/*
Date:20210514PM
key:从五开始，每次剪3会更好，用long才能取余
*/
class Solution {
public:
    int c(int&n)
    {
        const int base = 1000000007;
        long re=1;
        if(n<4){return n-1;}
        
        while(n>4)
        {
            re=(re*3)%base;
            n-=3;
        }
        return (re*n)%(base);
    }
    int cuttingRope(int n) {

        return c(n);
    }
};